#include"Account.h"
#include "CheckingAccount.h"
#include<iostream>
using namespace std;
CheckingAccount::CheckingAccount(double b,double f) : Account(balance){
    balance=b;
    feechargepertransaction=f;
}
void CheckingAccount::credit(double x){
    balance=balance+x-feechargepertransaction;
}
void CheckingAccount::debit(double x){
    if(Account::debit(x+feechargepertransaction)>balance){
        cout<<" error "<<endl;
    }
    else{
        balance=balance-x-feechargepertransaction;
    }
}